﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;
using System.Globalization;

namespace SolutionNavigateAddIn
{
    public class ProjectComparer : IComparer<Project>
    {
        static private StringComparer stringComparer;

        static ProjectComparer()
        {
            stringComparer = StringComparer.Create(CultureInfo.CurrentCulture, true);
        }

        /// <summary>
        /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
        /// </summary>
        /// <returns>
        /// Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y.
        /// </returns>
        /// <param name="y">The second object to compare.</param>
        /// <param name="x">The first object to compare.</param>
        public int Compare(Project x, Project y)
        {
            return stringComparer.Compare(x.Name, y.Name);
        }
    }
}